package com.cpf.dao;

import java.util.ArrayList;
import java.util.List;

import com.dao.ObjectDao;
import com.pro.bean.Card_View;
import com.pro.bean.Info;

public class ViewDao extends ObjectDao{
	/*public ArrayList GetInfoByCmp(String cmp)
	{
		String sql = "select * from Info where CMP = '"+cmp+"'";
		return (ArrayList) super.findAll(sql, new Info());
	}
	public ArrayList GetInfoByDepartment(String department)
	{
		String sql = "select * from Info where SECONDNAME = '"+department+"'";
		return (ArrayList) super.findAll(sql, new Info());
	}*/
	public ArrayList GetInfoByAll(String department,String cmp )
	{
		String sql = "select * from card_view where 1=1";
		if(department==null ||department.length() == 0 || department.equals("all"))
			;
		else
			sql += " and unitname='"+department+"'";
		if(cmp.length() != 0)
			sql += " and cmp='"+cmp+"'";
		System.out.println("sql+ "+sql);
		return (ArrayList) super.findAll(sql, new Card_View());
	}

}
